package com.imooc.retrofit;

import android.util.Log;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;

public class RetrofitClient {

    private static ServiceApi serviceApi;
    static {

        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .addInterceptor(new HttpLoggingInterceptor((message)->{
                    Log.e("TAG",message);
                }).setLevel(HttpLoggingInterceptor.Level.BODY))
                .build();


        Retrofit retrofit = new Retrofit.Builder()
                .baseUrl("")
                .client(okHttpClient)
                .build();

       serviceApi = retrofit.create(ServiceApi.class);
    }

    public static ServiceApi getServiceApi() {
        return serviceApi;
    }
}
